package com.juc.phaser.phaser13;

import java.util.concurrent.Phaser;

public class ThreadA extends Thread{
	/**
	 * awaitAdvanceInterruptibly(0) 是可中断的
	 */
	private Phaser phaser;
	
	public ThreadA(Phaser phaser) {
		super();
		this.phaser =phaser;
	}
	
	@Override
	public void run() {
		try {
			System.out.println(Thread.currentThread().getName() + " A1 begin = " +System.currentTimeMillis());
			phaser.awaitAdvanceInterruptibly(0); //符合栏数就wait
			System.out.println(Thread.currentThread().getName() + " A1 end = " +System.currentTimeMillis());
		} catch (InterruptedException e) {
			System.out.println(" 进入catch");
			e.printStackTrace();
		}
	}

}
